}
void
-gsk_matrix_transform_bounds (const graphene_matrix_t *m,
- const graphene_rect_t *r,
- graphene_rect_t *res)
+gsk_matrix_transform_rect (const graphene_matrix_t *m,
+ const graphene_rect_t *r,
+ graphene_quad_t *res)
{
graphene_point_t ret[4];
- float min_x, min_y;
- float max_x, max_y;
graphene_rect_t rr;
graphene_rect_normalize_r (r, &rr);
#undef TRANSFORM_POINT
- /* FIXME: graphene doesn't export a fast way to do this */
- min_x = MIN (MIN (ret[0].x, ret[1].x), MIN (ret[2].x, ret[3].x));
- min_y = MIN (MIN (ret[0].y, ret[1].y), MIN (ret[2].y, ret[3].y));
-
- max_x = MAX (MAX (ret[0].x, ret[1].x), MAX (ret[2].x, ret[3].x));
- max_y = MAX (MAX (ret[0].y, ret[1].y), MAX (ret[2].y, ret[3].y));
+ graphene_quad_init (res, &ret[0], &ret[1], &ret[2], &ret[3]);
+}
+void
+gsk_matrix_transform_bounds (const graphene_matrix_t *m,
+ const graphene_rect_t *r,
+ graphene_rect_t *res)
+{
+ graphene_quad_t q;
- graphene_rect_init (res, min_x, min_y, max_x - min_x, max_y - min_y);
+ gsk_matrix_transform_rect (m, r, &q);
+ graphene_quad_bounds (&q, res);
}
void gsk_matrix_transform_bounds (const graphene_matrix_t *m,
const graphene_rect_t *r,
graphene_rect_t *res);
-
+void gsk_matrix_transform_rect (const graphene_matrix_t *m,
+ const graphene_rect_t *r,
+ graphene_quad_t *res);
G_END_DECLS